gdk: Drop gdk_device_get/set_keys
authorMatthias Clasen <mclasen@redhat.com>
Tue, 9 Jun 2020 19:06:38 +0000 (15:06 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 9 Jun 2020 19:27:33 +0000 (15:27 -0400)
This functionality was only ever half-implemented
on X11, and is not useful enough to keep around.

docs/reference/gdk/gdk4-sections.txt
gdk/gdkdevice.c
gdk/gdkdevice.h
gdk/gdkdeviceprivate.h

index cc1bdd01893f9bd765908021f3fee86e415a2c0f..cb235271a840e617498b4e9f7432c8e121767e32 100644 (file)
@@ -357,8 +357,6 @@ gdk_device_get_name
 gdk_device_get_vendor_id
 gdk_device_get_product_id
 gdk_device_get_source
-gdk_device_set_key
-gdk_device_get_key
 gdk_device_set_axis_use
 gdk_device_get_axis_use
 gdk_device_get_associated_device
@@ -367,7 +365,6 @@ gdk_device_get_device_type
 gdk_device_get_display
 gdk_device_get_has_cursor
 gdk_device_get_n_axes
-gdk_device_get_n_keys
 gdk_device_get_axes
 gdk_device_get_seat
 gdk_device_get_num_touches
index 969d05f777d707238135929355ae679c5a5bdd04..6201631b07d4ed1f5abd6a8391e8172fc650a789 100644 (file)
@@ -393,7 +393,6 @@ gdk_device_finalize (GObject *object)
     }
 
   g_clear_pointer (&device->name, g_free);
-  g_clear_pointer (&device->keys, g_free);
   g_clear_pointer (&device->vendor_id, g_free);
   g_clear_pointer (&device->product_id, g_free);
 
@@ -684,79 +683,6 @@ gdk_device_get_source (GdkDevice *device)
   return device->source;
 }
 
-/**
- * gdk_device_get_n_keys:
- * @device: a #GdkDevice
- *
- * Returns the number of keys the device currently has.
- *
- * Returns: the number of keys.
- **/
-gint
-gdk_device_get_n_keys (GdkDevice *device)
-{
-  g_return_val_if_fail (GDK_IS_DEVICE (device), 0);
-
-  return device->num_keys;
-}
-
-/**
- * gdk_device_get_key:
- * @device: a #GdkDevice.
- * @index_: the index of the macro button to get.
- * @keyval: (out): return value for the keyval.
- * @modifiers: (out): return value for modifiers.
- *
- * If @index_ has a valid keyval, this function will return %TRUE
- * and fill in @keyval and @modifiers with the keyval settings.
- *
- * Returns: %TRUE if keyval is set for @index.
- **/
-gboolean
-gdk_device_get_key (GdkDevice       *device,
-                    guint            index_,
-                    guint           *keyval,
-                    GdkModifierType *modifiers)
-{
-  g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE);
-  g_return_val_if_fail (index_ < device->num_keys, FALSE);
-
-  if (!device->keys[index_].keyval &&
-      !device->keys[index_].modifiers)
-    return FALSE;
-
-  if (keyval)
-    *keyval = device->keys[index_].keyval;
-
-  if (modifiers)
-    *modifiers = device->keys[index_].modifiers;
-
-  return TRUE;
-}
-
-/**
- * gdk_device_set_key:
- * @device: a #GdkDevice
- * @index_: the index of the macro button to set
- * @keyval: the keyval to generate
- * @modifiers: the modifiers to set
- *
- * Specifies the X key event to generate when a macro button of a device
- * is pressed.
- **/
-void
-gdk_device_set_key (GdkDevice      *device,
-                    guint           index_,
-                    guint           keyval,
-                    GdkModifierType modifiers)
-{
-  g_return_if_fail (GDK_IS_DEVICE (device));
-  g_return_if_fail (index_ < device->num_keys);
-
-  device->keys[index_].keyval = keyval;
-  device->keys[index_].modifiers = modifiers;
-}
-
 /**
  * gdk_device_get_axis_use:
  * @device: a pointer #GdkDevice.
@@ -1273,16 +1199,6 @@ _gdk_device_get_axis_info (GdkDevice   *device,
   *resolution = info->resolution;
 }
 
-void
-_gdk_device_set_keys (GdkDevice *device,
-                      guint      num_keys)
-{
-  g_free (device->keys);
-
-  device->num_keys = num_keys;
-  device->keys = g_new0 (GdkDeviceKey, num_keys);
-}
-
 static GdkAxisInfo *
 find_axis_info (GArray     *array,
                 GdkAxisUse  use)
index a45a3163fb8acfd3b62b1b4e0abdb7201749ca7c..7f7aea3bfef81f96b169d4de57e99679ae5bce79 100644 (file)
@@ -115,19 +115,6 @@ gboolean              gdk_device_get_has_cursor (GdkDevice *device);
 GDK_AVAILABLE_IN_ALL
 GdkInputSource gdk_device_get_source (GdkDevice    *device);
 
-GDK_AVAILABLE_IN_ALL
-gint           gdk_device_get_n_keys    (GdkDevice       *device);
-GDK_AVAILABLE_IN_ALL
-gboolean       gdk_device_get_key       (GdkDevice       *device,
-                                         guint            index_,
-                                         guint           *keyval,
-                                         GdkModifierType *modifiers);
-GDK_AVAILABLE_IN_ALL
-void           gdk_device_set_key       (GdkDevice      *device,
-                                         guint           index_,
-                                         guint           keyval,
-                                         GdkModifierType modifiers);
-
 GDK_AVAILABLE_IN_ALL
 GdkAxisUse     gdk_device_get_axis_use  (GdkDevice         *device,
                                          guint              index_);
index de7c9e5c344bd1279294f8c2d6089b92369acca5..4ca7c9969443335adea50577fac9eb528c0e8805 100644 (file)
@@ -31,13 +31,6 @@ G_BEGIN_DECLS
 #define GDK_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE, GdkDeviceClass))
 
 typedef struct _GdkDeviceClass GdkDeviceClass;
-typedef struct _GdkDeviceKey GdkDeviceKey;
-
-struct _GdkDeviceKey
-{
-  guint keyval;
-  GdkModifierType modifiers;
-};
 
 struct _GdkDevice
 {
@@ -46,9 +39,7 @@ struct _GdkDevice
   gchar *name;
   GdkInputSource source;
   gboolean has_cursor;
-  gint num_keys;
   GdkAxisFlags axis_flags;
-  GdkDeviceKey *keys;
   GdkDisplay *display;
   /* Paired master for master,
    * associated master for slaves
@@ -119,9 +110,6 @@ void _gdk_device_get_axis_info (GdkDevice  *device,
                                gdouble    *max_value,
                                gdouble    *resolution);
 
-void _gdk_device_set_keys    (GdkDevice   *device,
-                              guint        num_keys);
-
 gboolean   _gdk_device_translate_surface_coord (GdkDevice *device,
                                                 GdkSurface *surface,
                                                 guint      index,